# Contributor: Jake Buchholz Göktürk <tomalok@gmail.com>
# Maintainer: Jake Buchholz Göktürk <tomalok@gmail.com>
pkgname=efs-utils
pkgver=1.33.1
pkgrel=0
pkgdesc="Utilities for Amazon Elastic File System (EFS)"
url="https://github.com/aws/efs-utils"
arch="noarch"
license="MIT"
depends="nfs-utils openssl py3-botocore stunnel"
options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/aws/$pkgname/archive/refs/tags/v$pkgver.tar.gz
	efs-utils_openrc.patch
	amazon-efs-mount-watchdog.initd
"
subpackages="
        $pkgname-doc
        $pkgname-openrc
"

package() {
	mkdir -p "$pkgdir"/var/log/amazon/efs
	install -Dm644 -t "$pkgdir"/etc/amazon/efs dist/efs-utils.conf
	install -Dm444 -t "$pkgdir"/etc/amazon/efs dist/efs-utils.crt
	install -Dm755 src/watchdog/__init__.py "$pkgdir"/usr/bin/amazon-efs-mount-watchdog
	install -Dm755 src/mount_efs/__init__.py "$pkgdir"/sbin/mount.efs
	install -Dm644 -t "$pkgdir"/usr/share/man/man8 man/mount.efs.8
	install -Dm755 "$srcdir"/amazon-efs-mount-watchdog.initd "$pkgdir"/etc/init.d/amazon-efs-mount-watchdog
}

sha512sums="
5a3353b46c6e8ac7a08c10752d7fb48944be7fb1b355298e44e8db1bb654f8bc1754aaaa35c4368b103a194f8c4252f72fedf063e9cbe2aa7b2c7d1efacc72ba  efs-utils-1.33.1.tar.gz
73c6617ad2ffd6cc647fbd6ec1c0fa677ae2703152aada2d92ed0476dccaffc14568b3641f13a1278005709fefadbae58170bb7c305a463a99553addb1be926a  efs-utils_openrc.patch
2fa52d7d722b224cd4e2bad43f0996f1e855321b388c226c4d5c1ecdd7182e7b95d5a930cd19e2df9af061128129a751b69c5cff0f3b95004c2d7fdb5daef795  amazon-efs-mount-watchdog.initd
"
